<html>
<head><meta charset="utf-8"><title>issue-52028-memory-usage-in-html5ever · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html">issue-52028-memory-usage-in-html5ever</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="129153825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129153825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129153825">(Jul 05 2018 at 18:06)</a>:</h4>
<p>So I had <a href="https://github.com/rust-lang/rust/issues/52028#issuecomment-402509289" target="_blank" title="https://github.com/rust-lang/rust/issues/52028#issuecomment-402509289">this idea for optimizing html5ever</a></p>



<a name="129153849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129153849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129153849">(Jul 05 2018 at 18:06)</a>:</h4>
<p>it basically just eliminates a big intermediate vector</p>



<a name="129153865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129153865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129153865">(Jul 05 2018 at 18:06)</a>:</h4>
<p>it would have to I think build on my branch though.. probably ..</p>



<a name="129153868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129153868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129153868">(Jul 05 2018 at 18:06)</a>:</h4>
<p>maybe not</p>



<a name="129153905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129153905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129153905">(Jul 05 2018 at 18:07)</a>:</h4>
<p>I'll have a look at doing that then. Which branch would you recommend working from?</p>



<a name="129153980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129153980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129153980">(Jul 05 2018 at 18:08)</a>:</h4>
<p>let me re-read my idae :)</p>



<a name="129154265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129154265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129154265">(Jul 05 2018 at 18:13)</a>:</h4>
<p>ok so I would probably start from my PR</p>



<a name="129154268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129154268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129154268">(Jul 05 2018 at 18:13)</a>:</h4>
<p>just because</p>



<a name="129154274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129154274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129154274">(Jul 05 2018 at 18:13)</a>:</h4>
<p>I dont' think there's anything in there that you <em>need</em></p>



<a name="129154286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129154286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129154286">(Jul 05 2018 at 18:13)</a>:</h4>
<p>this PR I mean <a href="https://github.com/rust-lang/rust/pull/51987" target="_blank" title="https://github.com/rust-lang/rust/pull/51987">https://github.com/rust-lang/rust/pull/51987</a></p>



<a name="129154330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129154330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129154330">(Jul 05 2018 at 18:14)</a>:</h4>
<p>but it seems like that will land</p>



<a name="129154339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129154339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129154339">(Jul 05 2018 at 18:14)</a>:</h4>
<p>and you'd probably get merge conflicts otherwise</p>



<a name="129155757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129155757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129155757">(Jul 05 2018 at 18:34)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> let me know how it goes; in the meantime, I'm going to open up an issue about the region error stuff and try to leave some notes</p>



<a name="129155799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129155799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129155799">(Jul 05 2018 at 18:35)</a>:</h4>
<p>Sounds good, just building your branch to get started.</p>



<a name="129174054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129174054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129174054">(Jul 06 2018 at 00:34)</a>:</h4>
<blockquote>
<p>That's a single 12 GiB allocation happening</p>
</blockquote>
<p>LOL</p>



<a name="129216713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129216713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129216713">(Jul 06 2018 at 18:18)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> So I'm looking at this issue - what do you envision we replace <code>Vec&lt;(ty::Region&lt;'tcx&gt;, Location)&gt;</code> with? I've been trying with <code>SparseBitMatrix&lt;RegionVid, LocationIndex&gt;</code> but there's some places where the <code>Vec</code> was iterated over and I'm not sure how to use the <code>SparseBitMatrix</code> in that context?</p>



<a name="129216723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129216723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129216723">(Jul 06 2018 at 18:18)</a>:</h4>
<p>Tried a handful of things and never got much of anywhere.</p>



<a name="129217358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129217358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129217358">(Jul 06 2018 at 18:32)</a>:</h4>
<p>I envisioned using <code>RegionValues</code> I think</p>



<a name="129217367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129217367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129217367">(Jul 06 2018 at 18:33)</a>:</h4>
<p>right now though, constructing a <code>RegionValues</code> requires knowing the total number of region variables</p>



<a name="129217490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129217490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129217490">(Jul 06 2018 at 18:35)</a>:</h4>
<p>I'm not sure exactly how I would alter the API; I debated around a few things</p>



<a name="129217541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129217541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129217541">(Jul 06 2018 at 18:36)</a>:</h4>
<p>I think I'd probably make it so that it doesn't know the number of variables and just instantiates them on demand</p>



<a name="129217551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129217551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129217551">(Jul 06 2018 at 18:36)</a>:</h4>
<blockquote>
<p>This implies to me that -- to start -- we could refactor so that type check generates the initial liveness results (storing in a sparse bit set per variable) directly. This would effectively replace the liveness_set vector that we have today. We would then hand that off to the region inference context</p>
</blockquote>
<p>I read this and went and looked for sparse bit sets.</p>



<a name="129218250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129218250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129218250">(Jul 06 2018 at 18:51)</a>:</h4>
<p>I think I've got it to check now with a <code>SparseBitMatrix</code> but I've no idea if it is correct or better in any way.</p>



<a name="129218254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129218254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129218254">(Jul 06 2018 at 18:51)</a>:</h4>
<p>(or what you wanted at all)</p>



<a name="129219295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219295">(Jul 06 2018 at 19:13)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> you're on the right track</p>



<a name="129219297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219297">(Jul 06 2018 at 19:13)</a>:</h4>
<p>I forgot that it used a <code>SparseBitMatrix</code> though</p>



<a name="129219300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219300">(Jul 06 2018 at 19:14)</a>:</h4>
<p>we'd have to modify that type to grow dynamically too</p>



<a name="129219342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219342">(Jul 06 2018 at 19:14)</a>:</h4>
<p>if we want this behavior</p>



<a name="129219343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219343">(Jul 06 2018 at 19:14)</a>:</h4>
<p>which...seems ok?</p>



<a name="129219346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219346">(Jul 06 2018 at 19:14)</a>:</h4>
<p>is all of this making any sense? :)</p>



<a name="129219349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219349">(Jul 06 2018 at 19:14)</a>:</h4>
<p>It didn't use a <code>SparseBitMatrix</code> before, I introduced one here because that's what I figured you meant.</p>



<a name="129219351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219351">(Jul 06 2018 at 19:14)</a>:</h4>
<p>I had no idea it wouldn't grow dynamically - this'll probably fail in that case.</p>



<a name="129219397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219397">(Jul 06 2018 at 19:15)</a>:</h4>
<p>sorry, I meant that <code>RegionValues</code> uses one</p>



<a name="129219401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219401">(Jul 06 2018 at 19:16)</a>:</h4>
<p>are you familiar with the <code>RegionValues</code> type?</p>



<a name="129219439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219439">(Jul 06 2018 at 19:16)</a>:</h4>
<p>(is that even the right name...)</p>



<a name="129219445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219445">(Jul 06 2018 at 19:16)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/region_infer/values/struct.RegionValues.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/region_infer/values/struct.RegionValues.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/region_infer/values/struct.RegionValues.html</a></p>



<a name="129219452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219452">(Jul 06 2018 at 19:16)</a>:</h4>
<p>Don't recall using it, I'm not using that just now.</p>



<a name="129219456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219456">(Jul 06 2018 at 19:16)</a>:</h4>
<p>this is the type we ultimately use to store the liveness results in the region inference context</p>



<a name="129219479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219479">(Jul 06 2018 at 19:17)</a>:</h4>
<p>this might be a place where it's useful to step back and talk about the regon inferene cx is setup</p>



<a name="129219482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219482">(Jul 06 2018 at 19:17)</a>:</h4>
<p>if you wanted, we could do a quick "guided tour"</p>



<a name="129219485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219485">(Jul 06 2018 at 19:17)</a>:</h4>
<p>(and I could tape it)</p>



<a name="129219490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219490">(Jul 06 2018 at 19:17)</a>:</h4>
<p>but it'd have to be ... kind of <em>now</em></p>



<a name="129219497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219497">(Jul 06 2018 at 19:17)</a>:</h4>
<p>anyway, this <a href="https://github.com/rust-lang/rust/blob/062a416dd4f12cf99b37d078a3da8dd81a1c008e/src/librustc_mir/borrow_check/nll/region_infer/mod.rs#L50-L54" target="_blank" title="https://github.com/rust-lang/rust/blob/062a416dd4f12cf99b37d078a3da8dd81a1c008e/src/librustc_mir/borrow_check/nll/region_infer/mod.rs#L50-L54">the field of the inference context where the liveness values are stored</a></p>



<a name="129219551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219551">(Jul 06 2018 at 19:18)</a>:</h4>
<p>what we do right now is to <em>first</em> build up the liveness values into this big array, and then transfer them into there</p>



<a name="129219554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219554">(Jul 06 2018 at 19:18)</a>:</h4>
<p>I can probably do that.</p>



<a name="129219555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219555">(Jul 06 2018 at 19:18)</a>:</h4>
<p>and what I am proposing is kind of building up that field during typeck</p>



<a name="129219634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219634">(Jul 06 2018 at 19:20)</a>:</h4>
<p>Here's what I changed: <a href="https://gist.github.com/davidtwco/f6fece99fb433a7506633dbdb321b4ab" target="_blank" title="https://gist.github.com/davidtwco/f6fece99fb433a7506633dbdb321b4ab">https://gist.github.com/davidtwco/f6fece99fb433a7506633dbdb321b4ab</a></p>



<a name="129219640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219640">(Jul 06 2018 at 19:20)</a>:</h4>
<p>Pretty certain it's the wrong direction.</p>



<a name="129219673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219673">(Jul 06 2018 at 19:21)</a>:</h4>
<p>yeah .. right direction maybe but I think we can do it .. I hope .. more easily?</p>



<a name="129219679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219679">(Jul 06 2018 at 19:21)</a>:</h4>
<p>That would be nice.</p>



<a name="129219684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219684">(Jul 06 2018 at 19:21)</a>:</h4>
<p>I am pondering a bit what I think the right steps are</p>



<a name="129219727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219727">(Jul 06 2018 at 19:22)</a>:</h4>
<p>Sure thing.</p>



<a name="129219748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219748">(Jul 06 2018 at 19:22)</a>:</h4>
<p>but yeah if you wanted I can kind of give you a quick overview of the total "information flow" here</p>



<a name="129219755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219755">(Jul 06 2018 at 19:23)</a>:</h4>
<p>That'd be helpful I reckon.</p>



<a name="129219773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219773">(Jul 06 2018 at 19:23)</a>:</h4>
<p>you want to do that now?</p>



<a name="129219786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219786">(Jul 06 2018 at 19:23)</a>:</h4>
<p>/me tries to decide if he has time</p>



<a name="129219798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219798">(Jul 06 2018 at 19:23)</a>:</h4>
<p>I'm leaving for a vacation tomorrow so got a few things to get done :)</p>



<a name="129219799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219799">(Jul 06 2018 at 19:23)</a>:</h4>
<p>If you've got time, I'm around now.</p>



<a name="129219870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219870">(Jul 06 2018 at 19:24)</a>:</h4>
<p>But it's not super important so don't bother if you've not.</p>



<a name="129219907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219907">(Jul 06 2018 at 19:24)</a>:</h4>
<p>let me ask you a different question</p>



<a name="129219942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219942">(Jul 06 2018 at 19:25)</a>:</h4>
<p>we could also discuss some the idea of how to improve the region errors</p>



<a name="129219975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219975">(Jul 06 2018 at 19:25)</a>:</h4>
<p>specifically this:</p>
<ul>
<li>code to find and highlight the precise part of the type where a region appears<br>
i.e., to say something like "let’s call the lifetime of this reference '1"<br>
seems like no matter what we’re going to want this</li>
</ul>



<a name="129219978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219978">(Jul 06 2018 at 19:25)</a>:</h4>
<p>Whichever you'd prefer I work on, I've not got a particular preference.</p>



<a name="129219990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219990">(Jul 06 2018 at 19:25)</a>:</h4>
<p>I have been meaning to write things up about it but haven't gotten to it</p>



<a name="129219991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129219991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129219991">(Jul 06 2018 at 19:26)</a>:</h4>
<p>hmm</p>



<a name="129220066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129220066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129220066">(Jul 06 2018 at 19:27)</a>:</h4>
<p>ok let's do something quickly</p>



<a name="129220072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129220072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129220072">(Jul 06 2018 at 19:27)</a>:</h4>
<p>let's talk about this issue since I think it's a bit more obvious</p>



<a name="129220074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129220074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129220074">(Jul 06 2018 at 19:27)</a>:</h4>
<p>and anyway my PR didn't land yet :)</p>



<a name="129220075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129220075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129220075">(Jul 06 2018 at 19:27)</a>:</h4>
<p>I'll try to write something up about <em>that</em> over the weekend</p>



<a name="129220118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129220118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129220118">(Jul 06 2018 at 19:28)</a>:</h4>
<p><a href="https://appear.in/i-heart-rust" target="_blank" title="https://appear.in/i-heart-rust">https://appear.in/i-heart-rust</a></p>



<a name="129221559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129221559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129221559">(Jul 06 2018 at 20:01)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> will be live at <a href="https://youtu.be/DqojDh9kFdI" target="_blank" title="https://youtu.be/DqojDh9kFdI">https://youtu.be/DqojDh9kFdI</a> once processing is complete; it's also in <a href="https://www.youtube.com/playlist?list=PLCQVvhKUrTN9VfaQx2AyOSAstwENaGkYA" target="_blank" title="https://www.youtube.com/playlist?list=PLCQVvhKUrTN9VfaQx2AyOSAstwENaGkYA">the playlist</a></p>



<a name="129269930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129269930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129269930">(Jul 07 2018 at 19:45)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I create <code>let elements = &amp;Rc::new(RegionValueElements::new(mir, universal_regions.len()));</code> and pass it into <code>type_check::type_check</code> which passes it into <code>type_check::type_check_internal</code> which makes the <code>RegionValues</code>. What should I do with <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/nll/type_check/mod.rs#L1648-L1649" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/nll/type_check/mod.rs#L1648-L1649">these lines</a> where I don't have a <code>universal_regions</code>?</p>



<a name="129269933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129269933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129269933">(Jul 07 2018 at 19:45)</a>:</h4>
<p>I can't find a nice way do it without everything ending up wrapped in <code>Option</code>.</p>



<a name="129270545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270545">(Jul 07 2018 at 20:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> you may want to add it to the <code>BorrowCheckContext</code></p>



<a name="129270551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270551">(Jul 07 2018 at 20:05)</a>:</h4>
<p>I added that at some point precisely because everything was getting wrapped up in options</p>



<a name="129270598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270598">(Jul 07 2018 at 20:06)</a>:</h4>
<p>see e.g. <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/nll/type_check/mod.rs#L119-L123" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/nll/type_check/mod.rs#L119-L123">this section</a></p>



<a name="129270600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270600">(Jul 07 2018 at 20:06)</a>:</h4>
<p>Oh yeah, that would work, I'd considered that at some point but for some reason thought otherwise.</p>



<a name="129270730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270730">(Jul 07 2018 at 20:10)</a>:</h4>
<p>Ah, so I think why I got tripped up with that was that it made it difficult to instantiate the <code>MirTypeckRegionConstraints</code> in <code>TypeChecker::new()</code> since it now takes a <code>RegionValues</code> - which I'm instantiating there and that requires a <code>elements</code>.</p>



<a name="129270735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270735">(Jul 07 2018 at 20:10)</a>:</h4>
<p>And wrapping that in <code>Option</code> is a pain as that's the return value of <code>type_check::type_check</code>.</p>



<a name="129270838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270838">(Jul 07 2018 at 20:14)</a>:</h4>
<p>Ah, I see. Still, those <em>are</em> only used in the borrow check mode.</p>



<a name="129270842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270842">(Jul 07 2018 at 20:14)</a>:</h4>
<p>I wonder if we should jus move those into the <code>BorrowCheckContext</code></p>



<a name="129270843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270843">(Jul 07 2018 at 20:14)</a>:</h4>
<p>e.g., with an <code>&amp;mut</code></p>



<a name="129270845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270845">(Jul 07 2018 at 20:14)</a>:</h4>
<p>I've contemplated doing so before</p>



<a name="129270853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270853">(Jul 07 2018 at 20:15)</a>:</h4>
<p>the whole setup feels a bit wonky, like it could be realigned, but I am not entirely sure how :)</p>



<a name="129270899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270899">(Jul 07 2018 at 20:16)</a>:</h4>
<p>What's the type check mir pass used for?</p>



<a name="129270900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270900">(Jul 07 2018 at 20:16)</a>:</h4>
<p>it's a sanity check</p>



<a name="129270901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270901">(Jul 07 2018 at 20:16)</a>:</h4>
<p>it checks that we generate well-formed MIR</p>



<a name="129270902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270902">(Jul 07 2018 at 20:16)</a>:</h4>
<p>but it doesn't consider regions etc</p>



<a name="129270912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270912">(Jul 07 2018 at 20:17)</a>:</h4>
<p>it's gonna go away once NLL lands</p>



<a name="129270914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270914">(Jul 07 2018 at 20:17)</a>:</h4>
<p>since NLL does the same thing</p>



<a name="129270915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270915">(Jul 07 2018 at 20:17)</a>:</h4>
<p>and then some</p>



<a name="129270919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270919">(Jul 07 2018 at 20:17)</a>:</h4>
<p>I suppose we could have it create the <code>RegionValueElements</code> etc but ...</p>



<a name="129270958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270958">(Jul 07 2018 at 20:18)</a>:</h4>
<p>or alternatively you could imagine removing it, and instead just having the MIR-based borrow check <em>always</em> run, but stop early if not enabled</p>



<a name="129270959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270959">(Jul 07 2018 at 20:18)</a>:</h4>
<p>that'd probably be the way to go</p>



<a name="129270961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270961">(Jul 07 2018 at 20:18)</a>:</h4>
<p>Even if I put the elements as close as possible to where it is used, at that point the universal regions is in an <code>Option</code> and I've got the same issue.</p>



<a name="129270963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270963">(Jul 07 2018 at 20:18)</a>:</h4>
<p>I'm reluctant to remove it altogher both because it's useful <em>and</em> because it would make NLL performance look worse <span class="emoji emoji-1f61b" title="stuck out tongue">:stuck_out_tongue:</span></p>



<a name="129270972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270972">(Jul 07 2018 at 20:19)</a>:</h4>
<p>I don't think I quite understand</p>



<a name="129270974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270974">(Jul 07 2018 at 20:19)</a>:</h4>
<p>can you send me your diff? :)</p>



<a name="129270978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270978">(Jul 07 2018 at 20:19)</a>:</h4>
<p>(or, better, the commit)</p>



<a name="129270979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129270979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129270979">(Jul 07 2018 at 20:19)</a>:</h4>
<p>and maybe the compiler error</p>



<a name="129271034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271034">(Jul 07 2018 at 20:21)</a>:</h4>
<div class="codehilite"><pre><span></span>error[E0425]: cannot find value `elements` in this scope
   --&gt; librustc_mir/borrow_check/nll/type_check/mod.rs:737:57
    |
737 |                 liveness_constraints: RegionValues::new(elements),
    |                                                         ^^^^^^^^ not found in this scope

error[E0308]: mismatched types
  --&gt; librustc_mir/borrow_check/nll/constraint_generation.rs:43:56
   |
43 |     cg.add_region_liveness_constraints_from_type_check(liveness_set_from_typeck);
   |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found struct `borrow_check::nll::region_infer::values::RegionValues`
   |
   = note: expected type `&amp;[(&amp;rustc::ty::RegionKind, rustc::mir::Location)]`
              found type `&amp;borrow_check::nll::region_infer::values::RegionValues&lt;rustc::ty::RegionVid&gt;`

error: aborting due to 2 previous errors
</pre></div>


<p>Here's a branch with a WIP commit: <a href="https://github.com/davidtwco/rust/tree/issue-52028" target="_blank" title="https://github.com/davidtwco/rust/tree/issue-52028">https://github.com/davidtwco/rust/tree/issue-52028</a></p>



<a name="129271083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271083">(Jul 07 2018 at 20:22)</a>:</h4>
<p>What I was suggesting though was that if I move where I create <code>elements</code> such that it's created inside the <code>type_check</code> module and returned alongside the <code>RegionValues</code> (which could work..) then at the point where I'd create <code>elements</code>, the number of universal regions is within the <code>Option&lt;BorrowCheckContext&gt;</code> and therefore the issue just manifests itself slightly differently.</p>



<a name="129271086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271086">(Jul 07 2018 at 20:23)</a>:</h4>
<p>The second error there can be ignored, I've just not around to dealing with that part of the code.</p>



<a name="129271089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271089">(Jul 07 2018 at 20:23)</a>:</h4>
<p>I think you should move the creation into the <code>BorrowCheckContext</code> struct</p>



<a name="129271096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271096">(Jul 07 2018 at 20:23)</a>:</h4>
<p>and not have a return value</p>



<a name="129271102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271102">(Jul 07 2018 at 20:23)</a>:</h4>
<p>so e.g. <code>BorrowCheckContext</code> could have a <code>&amp;mut MirTypeckRegionConstraints&lt;'tcx&gt;</code></p>



<a name="129271103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271103">(Jul 07 2018 at 20:23)</a>:</h4>
<p>I see.</p>



<a name="129271104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271104">(Jul 07 2018 at 20:24)</a>:</h4>
<p>there are two places that we write to <code>constraints</code></p>



<a name="129271141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271141">(Jul 07 2018 at 20:24)</a>:</h4>
<p>Yeah, alright, I'll give that a go.</p>



<a name="129271144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271144">(Jul 07 2018 at 20:24)</a>:</h4>
<p>one of them already checked that <code>BorrowCheckConstraints</code> is <code>Some</code></p>



<a name="129271145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271145">(Jul 07 2018 at 20:24)</a>:</h4>
<p>the other one <em>could have done</em> :)</p>



<a name="129271146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271146">(Jul 07 2018 at 20:24)</a>:</h4>
<p>basically the same as the <code>&amp;mut AllFacts</code> that's already in there</p>



<a name="129271491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129271491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129271491">(Jul 07 2018 at 20:36)</a>:</h4>
<p>That worked, thanks.</p>



<a name="129373994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129373994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129373994">(Jul 09 2018 at 21:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Submitted <a href="https://github.com/rust-lang/rust/pull/52190" target="_blank" title="https://github.com/rust-lang/rust/pull/52190">https://github.com/rust-lang/rust/pull/52190</a> for this. Not passing the tests yet, but the bulk of it is there.</p>



<a name="129374105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129374105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129374105">(Jul 09 2018 at 21:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> awesome :D</p>



<a name="129516878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129516878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129516878">(Jul 12 2018 at 05:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> nice! (I'm still on vacation, trying to catch up a <em>bit</em> though -- beginning with rebasing <a href="https://github.com/rust-lang/rust/pull/51987" target="_blank" title="https://github.com/rust-lang/rust/pull/51987">https://github.com/rust-lang/rust/pull/51987</a>)</p>



<a name="129554651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129554651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129554651">(Jul 12 2018 at 18:43)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> rebased</p>



<a name="129557909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129557909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129557909">(Jul 12 2018 at 19:34)</a>:</h4>
<p>(tiny typo during the rebase if you haven't seen it yet)</p>



<a name="129558495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129558495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129558495">(Jul 12 2018 at 19:46)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> oops, thanks, completely forgot to do a check on it before pushing.</p>



<a name="129558572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129558572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129558572">(Jul 12 2018 at 19:48)</a>:</h4>
<p>:)</p>



<a name="129558801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129558801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129558801">(Jul 12 2018 at 19:52)</a>:</h4>
<p>Alright, fixed.</p>



<a name="129590532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129590532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129590532">(Jul 13 2018 at 09:24)</a>:</h4>
<p>It occurs to me looking at this that I misread your initial message and it wasn't instruction to rebase over that PR again (though it was required so it didn't hurt to do).</p>



<a name="129610456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129610456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129610456">(Jul 13 2018 at 16:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> so it seems like <a href="https://github.com/rust-lang/rust/pull/51987" target="_blank" title="https://github.com/rust-lang/rust/pull/51987">https://github.com/rust-lang/rust/pull/51987</a> has landed; you may want to rebase atop master now</p>



<a name="129613928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129613928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129613928">(Jul 13 2018 at 17:12)</a>:</h4>
<p>Rebased ontop of master now.</p>



<a name="129646825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129646825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129646825">(Jul 14 2018 at 04:51)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> left a <a href="https://github.com/rust-lang/rust/pull/52190#pullrequestreview-137228629" target="_blank" title="https://github.com/rust-lang/rust/pull/52190#pullrequestreview-137228629">first round of review</a>, just looking at the changes to make <code>SparseBitMatrix</code> lazy</p>



<a name="129647096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129647096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129647096">(Jul 14 2018 at 05:01)</a>:</h4>
<p>ok, left a second round of feedback on the rest</p>



<a name="129744400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129744400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129744400">(Jul 16 2018 at 11:35)</a>:</h4>
<p>Put a PR in that should have resolved those issues. I've not had much time to look into the failure that's happening just now. Will try to get to that tonight.</p>



<a name="129744622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129744622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129744622">(Jul 16 2018 at 11:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> to clarify, you mean the same PR, right?</p>



<a name="129745285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129745285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129745285">(Jul 16 2018 at 11:58)</a>:</h4>
<p>Ah, yeah, I meant to say commit.</p>



<a name="129745293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129745293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129745293">(Jul 16 2018 at 11:58)</a>:</h4>
<p>Too late to edit now.</p>



<a name="129745611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129745611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129745611">(Jul 16 2018 at 12:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> did you ever figure out what those travis errors are about? Do you want me to take a look? It might just be "things happening in a slightly different order"</p>



<a name="129746607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129746607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129746607">(Jul 16 2018 at 12:28)</a>:</h4>
<p>I haven't had a chance to properly dig in.</p>



<a name="129746612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129746612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129746612">(Jul 16 2018 at 12:29)</a>:</h4>
<p>Its the visited vec in some of the SCC functions.</p>



<a name="129746623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129746623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129746623">(Jul 16 2018 at 12:29)</a>:</h4>
<p>If you have time and want to take a look I don't mind.</p>



<a name="129746987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129746987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129746987">(Jul 16 2018 at 12:37)</a>:</h4>
<p>I'll clone it</p>



<a name="129755629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129755629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129755629">(Jul 16 2018 at 15:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> so far most of the errors I see are ICEs relating to the lazy bit set code. I'm fixing those bit by bit. This mess of bitsets is SUCH a candidate for being pulled out to an external crate where it can be properly vetted and tested...</p>



<a name="129755921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129755921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129755921">(Jul 16 2018 at 15:12)</a>:</h4>
<p>By lazy bit set do you mean the type underpinning the <code>SparseBitMatrix</code> or the changes to the <code>SparseBitMatrix</code>?</p>



<a name="129756397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129756397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129756397">(Jul 16 2018 at 15:19)</a>:</h4>
<p>the changes that make it grow automatically, I mean</p>



<a name="129756467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129756467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129756467">(Jul 16 2018 at 15:20)</a>:</h4>
<p>I'm now past the obvious ICEs</p>



<a name="129756470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129756470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129756470">(Jul 16 2018 at 15:20)</a>:</h4>
<p>will push those</p>



<a name="129756472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129756472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129756472">(Jul 16 2018 at 15:20)</a>:</h4>
<p>now getting new errors ;)</p>



<a name="129756629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129756629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129756629">(Jul 16 2018 at 15:22)</a>:</h4>
<p>The only ICE I was seeing (at least with the test I was looking at) was the <code>visited</code> vector being empty when it wasn't supposed to be in the SCC code. Given that I didn't get a chance to work that out, I wasn't aware that the bit matrix changes had any issues. Though, perhaps I just had to find time to dig deeper.</p>



<a name="129756773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129756773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129756773">(Jul 16 2018 at 15:24)</a>:</h4>
<p>pushed a commit or two</p>



<a name="129757216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129757216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129757216">(Jul 16 2018 at 15:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> I'm investigating the remaining ICEs</p>



<a name="129757227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129757227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129757227">(Jul 16 2018 at 15:31)</a>:</h4>
<p>PS we should talk about further region error reporting work too ... :)</p>



<a name="129757906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129757906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129757906">(Jul 16 2018 at 15:41)</a>:</h4>
<p>ah, I see the problem</p>



<a name="129757911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129757911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129757911">(Jul 16 2018 at 15:41)</a>:</h4>
<p>I didn't read the <code>resize_with</code> rustdocs closely enough :)</p>



<a name="129757913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129757913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129757913">(Jul 16 2018 at 15:41)</a>:</h4>
<p>it will sometimes truncate!</p>



<a name="129758522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129758522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129758522">(Jul 16 2018 at 15:50)</a>:</h4>
<p>Ah. I'm not sure if I checked the ICE last night after it finished building successfully because it was late.</p>



<a name="129758527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129758527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129758527">(Jul 16 2018 at 15:50)</a>:</h4>
<p>So the ICE may have changed.</p>



<a name="129758731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129758731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129758731">(Jul 16 2018 at 15:53)</a>:</h4>
<p>I think it all works now</p>



<a name="129759363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129759363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129759363">(Jul 16 2018 at 16:01)</a>:</h4>
<p>Great!</p>



<a name="129759434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129759434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129759434">(Jul 16 2018 at 16:02)</a>:</h4>
<p>at least src/test/ui passes :)</p>



<a name="129799307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129799307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129799307">(Jul 17 2018 at 07:41)</a>:</h4>
<p>Apologies for not being able to wrap up those last few issues. Did we see much of an impact from the change with the memory usage?</p>



<a name="129801067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129801067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129801067">(Jul 17 2018 at 08:30)</a>:</h4>
<p>for sure</p>



<a name="129801172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129801172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129801172">(Jul 17 2018 at 08:32)</a>:</h4>
<p>(and not only memory apparently)</p>



<a name="129801905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129801905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129801905">(Jul 17 2018 at 08:52)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> does it say the memory diff on perf.rust-lang?</p>



<a name="129801913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129801913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129801913">(Jul 17 2018 at 08:53)</a>:</h4>
<p>yes let me get you a link</p>



<a name="129801930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129801930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129801930">(Jul 17 2018 at 08:53)</a>:</h4>
<p><a href="https://perf.rust-lang.org/compare.html?start=3d5753fda1ee8f729da1061e931e13b043f479a5&amp;end=c1ea2d1eb1304c9d8de16b74ae863a8e1e58cd2f&amp;stat=max-rss" target="_blank" title="https://perf.rust-lang.org/compare.html?start=3d5753fda1ee8f729da1061e931e13b043f479a5&amp;end=c1ea2d1eb1304c9d8de16b74ae863a8e1e58cd2f&amp;stat=max-rss">https://perf.rust-lang.org/compare.html?start=3d5753fda1ee8f729da1061e931e13b043f479a5&amp;end=c1ea2d1eb1304c9d8de16b74ae863a8e1e58cd2f&amp;stat=max-rss</a></p>



<a name="129801938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129801938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129801938">(Jul 17 2018 at 08:54)</a>:</h4>
<p>at the bottom left there is a selector for which perf stat you want to show</p>



<a name="129802584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129802584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129802584">(Jul 17 2018 at 09:08)</a>:</h4>
<p>Ah, thanks. Wasn't sure which one was memory usage.</p>



<a name="129802591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129802591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129802591">(Jul 17 2018 at 09:08)</a>:</h4>
<p>Hopefully someone can have bors try again with that PR soon.</p>



<a name="129802897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129802897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129802897">(Jul 17 2018 at 09:14)</a>:</h4>
<p>yeah it's a known travis issue at 6-7AM :) I've had it before; we can ping someone on the infra team if they're available (they might be sleeping :)</p>



<a name="129803667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129803667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129803667">(Jul 17 2018 at 09:35)</a>:</h4>
<p>(alrighty, it's been retried)</p>



<a name="129806722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129806722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129806722">(Jul 17 2018 at 11:03)</a>:</h4>
<p>still, the perf is atrocious :( I had hoped reducing the peak memory usage would do it, but apparently not. I expect though that the <a href="https://github.com/rust-lang/rust/issues/52034" target="_blank" title="https://github.com/rust-lang/rust/issues/52034">#52034</a> change that <span class="user-mention" data-user-id="120823">@DPC</span> is working on <em>may</em> have a big effect</p>



<a name="129806727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129806727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129806727">(Jul 17 2018 at 11:03)</a>:</h4>
<p>also, 2GB is still ungreat.</p>



<a name="129806731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129806731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129806731">(Jul 17 2018 at 11:03)</a>:</h4>
<p>I wonder if there is much we can do to improve further</p>



<a name="129806769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129806769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129806769">(Jul 17 2018 at 11:04)</a>:</h4>
<p>seems almost certainly yes, would have to do a more compressed representation though</p>



<a name="129807103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807103">(Jul 17 2018 at 11:14)</a>:</h4>
<p>perhaps something that takes advantage of repeated substructure, like a BDD</p>



<a name="129807398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807398">(Jul 17 2018 at 11:21)</a>:</h4>
<p>did we ever profile html5ever ?</p>



<a name="129807450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807450">(Jul 17 2018 at 11:22)</a>:</h4>
<p>I was just getting started on that</p>



<a name="129807452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807452">(Jul 17 2018 at 11:22)</a>:</h4>
<p>I'm going to build w/ <span class="user-mention" data-user-id="116107">@David Wood</span>'s branch</p>



<a name="129807453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807453">(Jul 17 2018 at 11:22)</a>:</h4>
<p>I don't remember us doing so</p>



<a name="129807455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807455">(Jul 17 2018 at 11:22)</a>:</h4>
<p>yeah</p>



<a name="129807458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807458">(Jul 17 2018 at 11:22)</a>:</h4>
<p>esp because of the OOMs I mean</p>



<a name="129807463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807463">(Jul 17 2018 at 11:22)</a>:</h4>
<p>hopefully it's liveness so that 52034 fixes it</p>



<a name="129807605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807605">(Jul 17 2018 at 11:26)</a>:</h4>
<p>started builds</p>



<a name="129807609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807609">(Jul 17 2018 at 11:26)</a>:</h4>
<p>well I expect liveness is a big part of it and that <a href="https://github.com/rust-lang/rust/issues/52034" target="_blank" title="https://github.com/rust-lang/rust/issues/52034">#52034</a> will <em>help</em></p>



<a name="129807613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807613">(Jul 17 2018 at 11:26)</a>:</h4>
<p>let me review what njn wrote...</p>



<a name="129807624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129807624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129807624">(Jul 17 2018 at 11:27)</a>:</h4>
<p>ah, yes, <code>precompute_borrows_out_of_scope</code>, our old friend</p>



<a name="129816506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816506">(Jul 17 2018 at 14:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> html5ever perf profile is kind of interesting:</p>
<div class="codehilite"><pre><span></span>athena. perf focus &#39;{do_mir_borrowck}&#39; --tree-callees --tree-max-depth 3 --tree-min-percent 5 --relative
Matcher    : {do_mir_borrowck}
Matches    : 5379
Not Matches: 739
Percentage : 100%

Tree
| matched `{do_mir_borrowck}` (100% total, 0% self)
: | rustc_mir::borrow_check::nll::compute_regions (51% total, 0% self)
: : | rustc_mir::borrow_check::nll::type_check::type_check (47% total, 0% self)
: : : | rustc_mir::borrow_check::nll::type_check::liveness::generate (47% total, 0% self) [...]
: | rustc_mir::dataflow::impls::borrows::Borrows::new (31% total, 3% self)
: : | &lt;std::collections::hash::map::HashMap&lt;K, V, S&gt;&gt;::insert (14% total, 7% self)
: : : | &lt;std::collections::hash::map::HashMap&lt;K, V, S&gt;&gt;::try_resize (6% total, 4% self) [...]
: : | &lt;rustc_mir::borrow_check::nll::region_infer::values::RegionValues&lt;N&gt;&gt;::contains (12% total, 12% self)
: | &lt;rustc_mir::borrow_check::MirBorrowckCtxt&lt;&#39;cx, &#39;gcx, &#39;tcx&gt; as rustc_mir::dataflow::DataflowResultsConsumer&lt;&#39;cx, &#39;tcx&gt;&gt;::visit_statement_entry (15% total, 0% self)
: : | rustc_mir::borrow_check::MirBorrowckCtxt::consume_operand (5% total, 0% self)
: : : | rustc_mir::borrow_check::MirBorrowckCtxt::access_place (5% total, 0% self) [...]
: : | rustc_mir::borrow_check::MirBorrowckCtxt::mutate_place (5% total, 0% self)
: : : | rustc_mir::borrow_check::MirBorrowckCtxt::access_place (5% total, 0% self) [...]
</pre></div>



<a name="129816529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816529">(Jul 17 2018 at 14:43)</a>:</h4>
<p>RegionValues::contains <span class="emoji emoji-1f914" title="thinking face">:thinking_face:</span></p>



<a name="129816531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816531">(Jul 17 2018 at 14:43)</a>:</h4>
<p>this <em>may</em> mean that <span class="user-mention" data-user-id="120823">@DPC</span>'s work on <a href="https://github.com/rust-lang/rust/issues/52034" target="_blank" title="https://github.com/rust-lang/rust/issues/52034">#52034</a> will be huge -- depends on how much of the <code>liveness::generate</code> is from variables that contain regions</p>



<a name="129816541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816541">(Jul 17 2018 at 14:44)</a>:</h4>
<p>well, that is I think from the code that figures out the "lifetime" of each borrow</p>



<a name="129816590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816590">(Jul 17 2018 at 14:44)</a>:</h4>
<p>it does a DFS from the start of the borrow</p>



<a name="129816591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816591">(Jul 17 2018 at 14:44)</a>:</h4>
<p>and watches out for exits from the region</p>



<a name="129816602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816602">(Jul 17 2018 at 14:44)</a>:</h4>
<p>there is definitely something kind of "ugh" there</p>



<a name="129816606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816606">(Jul 17 2018 at 14:44)</a>:</h4>
<p>because we then later do a dataflow</p>



<a name="129816609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816609">(Jul 17 2018 at 14:44)</a>:</h4>
<p>which essentially duplicates that work</p>



<a name="129816616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816616">(Jul 17 2018 at 14:44)</a>:</h4>
<p>but I'm not sure how to do better than the DFS per borrow yet</p>



<a name="129816629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816629">(Jul 17 2018 at 14:45)</a>:</h4>
<p>we could remove the dataflow later on, though it doesn't seem to be particularly high on any profile</p>



<a name="129816633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816633">(Jul 17 2018 at 14:45)</a>:</h4>
<p>just silly</p>



<a name="129816640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816640">(Jul 17 2018 at 14:45)</a>:</h4>
<p>do we have a way of guesstimating how many of these liveness requests are actually from variables with regions ?</p>



<a name="129816643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816643">(Jul 17 2018 at 14:45)</a>:</h4>
<p>the DFS itself could be coded more efficiently I imagine</p>



<a name="129816652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816652">(Jul 17 2018 at 14:45)</a>:</h4>
<p>hard to tell; I can check the mir-dump debug info I suppose</p>



<a name="129816699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816699">(Jul 17 2018 at 14:46)</a>:</h4>
<p>it's gonna be huge</p>



<a name="129816711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816711">(Jul 17 2018 at 14:46)</a>:</h4>
<p>indeed</p>



<a name="129816714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816714">(Jul 17 2018 at 14:46)</a>:</h4>
<p>running that now</p>



<a name="129816718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816718">(Jul 17 2018 at 14:46)</a>:</h4>
<p>there must be some huge fn</p>



<a name="129816722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816722">(Jul 17 2018 at 14:46)</a>:</h4>
<p>I suspect that a lot of those variables contain regions</p>



<a name="129816728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816728">(Jul 17 2018 at 14:46)</a>:</h4>
<p>because we seem to have a lot of loans to trace out :)</p>



<a name="129816749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816749">(Jul 17 2018 at 14:47)</a>:</h4>
<p>now I'm intrigued what the offending code looks like in html5ever :D</p>



<a name="129816844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816844">(Jul 17 2018 at 14:48)</a>:</h4>
<p>heh indeed</p>



<a name="129816940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816940">(Jul 17 2018 at 14:50)</a>:</h4>
<p>well, I see 38% of total execution time spent traversing types, looking for regions that are live</p>



<a name="129816952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816952">(Jul 17 2018 at 14:51)</a>:</h4>
<p>you already added the "quick check" that skips that if there are no live regions</p>



<a name="129816966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129816966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129816966">(Jul 17 2018 at 14:51)</a>:</h4>
<p>hmm</p>



<a name="129817014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817014">(Jul 17 2018 at 14:52)</a>:</h4>
<p>I wonder if it would be faster to "invert" the liveness code</p>



<a name="129817027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817027">(Jul 17 2018 at 14:52)</a>:</h4>
<p>I am trying to remember :) I seem to recall this being true in a previous compiler I worked on</p>



<a name="129817031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817031">(Jul 17 2018 at 14:52)</a>:</h4>
<p>that is, traditional liveness figures out the liveness of all variables at each point</p>



<a name="129817039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817039">(Jul 17 2018 at 14:52)</a>:</h4>
<p>but another way to do it is to look for any given variable and find the points where it is live</p>



<a name="129817042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817042">(Jul 17 2018 at 14:52)</a>:</h4>
<p>we are more interested in <em>that</em> in the end</p>



<a name="129817054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817054">(Jul 17 2018 at 14:53)</a>:</h4>
<p>i.e., you could imagine creating a <code>SparseBitSet</code> for each variable that has regions in its type</p>



<a name="129817059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817059">(Jul 17 2018 at 14:53)</a>:</h4>
<p>oh interesting</p>



<a name="129817060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817060">(Jul 17 2018 at 14:53)</a>:</h4>
<p>iterating over all uses of the variable and walking backwards from each one</p>



<a name="129817067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817067">(Jul 17 2018 at 14:53)</a>:</h4>
<p>annoyingly, we don't have a ready index for that</p>



<a name="129817073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817073">(Jul 17 2018 at 14:53)</a>:</h4>
<p>but I suppose we could build one in a single O(n) walk</p>



<a name="129817093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817093">(Jul 17 2018 at 14:53)</a>:</h4>
<p>the advantage would be:</p>



<a name="129817102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817102">(Jul 17 2018 at 14:54)</a>:</h4>
<p>we get a bitset for each variable</p>



<a name="129817140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817140">(Jul 17 2018 at 14:54)</a>:</h4>
<p>then we iterate the regions within the variable ONCE</p>



<a name="129817143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817143">(Jul 17 2018 at 14:54)</a>:</h4>
<p>and or the entire bitset into them</p>



<a name="129817156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817156">(Jul 17 2018 at 14:54)</a>:</h4>
<p>instead of what we do now, which is to iterate the regions in the variable at each point and add a single bit</p>



<a name="129817184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817184">(Jul 17 2018 at 14:55)</a>:</h4>
<p>in other words, there is a sort of impedance mismatch right now with the current setup</p>



<a name="129817196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817196">(Jul 17 2018 at 14:55)</a>:</h4>
<p>this may also simplify the "Drop live" vs "Use live" distinction</p>



<a name="129817206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817206">(Jul 17 2018 at 14:55)</a>:</h4>
<p>that is, we would basically walk backwards from drops -- if we encounter a USE, that converts into a USE LIVE, but it's all still part of a single visit</p>



<a name="129817216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817216">(Jul 17 2018 at 14:55)</a>:</h4>
<p>right now we actually compute liveness TWICE I think</p>



<a name="129817233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817233">(Jul 17 2018 at 14:56)</a>:</h4>
<p>yeah, this seems like a win</p>



<a name="129817261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817261">(Jul 17 2018 at 14:56)</a>:</h4>
<p>or at least worth a try</p>



<a name="129817304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817304">(Jul 17 2018 at 14:57)</a>:</h4>
<p>sounds worth a try indeed!</p>



<a name="129817371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817371">(Jul 17 2018 at 14:58)</a>:</h4>
<p>sort of sad to have two bits of liveness code but ... c'est la vie</p>



<a name="129817595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817595">(Jul 17 2018 at 15:02)</a>:</h4>
<p>I do wonder if the behavior with html5ever is a rare incident or if it's a pattern we already encounter at a smaller scale, maybe hidden in the perf overhead we're seeing elsewhere</p>



<a name="129817709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817709">(Jul 17 2018 at 15:05)</a>:</h4>
<p>yeah</p>



<a name="129817712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817712">(Jul 17 2018 at 15:05)</a>:</h4>
<p>hard to know</p>



<a name="129817718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817718">(Jul 17 2018 at 15:05)</a>:</h4>
<p>it is certainly also true for tuple-stress</p>



<a name="129817763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817763">(Jul 17 2018 at 15:06)</a>:</h4>
<p>but that case has an easy fix (ignore non-region variables)</p>



<a name="129817850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129817850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129817850">(Jul 17 2018 at 15:08)</a>:</h4>
<p>yeah. maybe I'll look at this crate a bit later as well (I remember it needs bigger stack sizes to build because of heavy macro/syn/quote usage :)</p>



<a name="129819702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129819702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129819702">(Jul 17 2018 at 15:47)</a>:</h4>
<p>(hehe the current version of html5ever cargo checks just fine in 2s, 30x faster than this 2y old version)</p>



<a name="129819941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129819941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129819941">(Jul 17 2018 at 15:52)</a>:</h4>
<p>the non-NLL version cargo checks in 1.8 seconds :)</p>



<a name="129819975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129819975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129819975">(Jul 17 2018 at 15:53)</a>:</h4>
<p>opened up <a href="https://github.com/rust-lang/rust/issues/52460" target="_blank" title="https://github.com/rust-lang/rust/issues/52460">https://github.com/rust-lang/rust/issues/52460</a></p>



<a name="129819978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129819978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129819978">(Jul 17 2018 at 15:53)</a>:</h4>
<p>still, <span class="user-mention" data-user-id="116113">@lqd</span>, that is very interesting</p>



<a name="129819981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129819981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129819981">(Jul 17 2018 at 15:53)</a>:</h4>
<p>in particular, when we talk about our NLL performance targets</p>



<a name="129819984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129819984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129819984">(Jul 17 2018 at 15:53)</a>:</h4>
<p>we really want to check current crates :)</p>



<a name="129820075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129820075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129820075">(Jul 17 2018 at 15:55)</a>:</h4>
<p>Generally speaking though optimizing NLL for the pain points (e.g. this html5ever) may bring wins to the other crates which is why I think it's worth it</p>



<a name="129820133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129820133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129820133">(Jul 17 2018 at 15:56)</a>:</h4>
<p>yeah, on the one hand we're lucky that the old version showcases a pathological case in rustc, and on the other, lucky that people will, <em>hopefully</em>, have a better experience than one might think just looking at the nll perf dashboard :)</p>



<a name="129820151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129820151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129820151">(Jul 17 2018 at 15:57)</a>:</h4>
<p>oh for sure <span class="user-mention" data-user-id="116122">@simulacrum</span></p>



<a name="129820214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129820214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129820214">(Jul 17 2018 at 15:58)</a>:</h4>
<p>I'm sure there are new crates that have the same pathological behavior too</p>



<a name="129820517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever/near/129820517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52028-memory-usage-in-html5ever.html#129820517">(Jul 17 2018 at 16:04)</a>:</h4>
<p>maybe some of the ones which OOMed during the crater run</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>